﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.Text;
using System.IO;

namespace Web4Comment
{
    public partial class WebTest : System.Web.UI.Page
    {
        public long x;
        DateTime d;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                x = Web4Comment.Service.ChatTimeService.logFriendStartTime(1, DateTime.Now, 2);
                Label1.Text = x.ToString();
                d = DateTime.Now;
            }

        }


        protected void Button1_Click1(object sender, EventArgs e)
        {

            Web4Comment.Service.ChatTimeService.logEndTime(System.Int64.Parse(Label1.Text), DateTime.Now);
            System.TimeSpan xx = DateTime.Now - d;
            Label1.Text = Label1.Text;
        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            Web4Comment.Service.ChatTimeService.logEndTime(System.Int64.Parse(Label1.Text), DateTime.Now);
            System.TimeSpan xx = DateTime.Now - d;
            Label1.Text = Label1.Text;
        }

        protected void Button4_Click(object sender, EventArgs e)
        {
            System.TimeSpan xx = Web4Comment.Service.ChatTimeService.calculateFriendTime(1, 2);
            Label1.Text = xx.Days + ":" + xx.Hours + ":" + xx.Minutes;
        }
    }
}